import Cookies from 'js-cookie'

/**
 * oauth2 access_token
 * @type {string}
 */
const access_token = 'access_token'
/**
 * oauth2 refresh_token
 * @type {string}
 */
const refresh_token = 'refresh_token'

export function getToken() {
  return Cookies.get(access_token)
}

export function setToken(accessToken, refreshToken) {
  Cookies.set(access_token, accessToken)
  Cookies.set(refresh_token, refreshToken)
}

export function removeToken() {
  Cookies.remove(access_token)
  Cookies.remove(refresh_token)
}
